package com.feihong.txgw.utils.order;

import android.content.Context;
import android.view.Gravity;
import android.view.View;

import q.rorbin.badgeview.QBadgeView;


/**
 * 数字提示工具类
 * 张鹏
 * 2017.7.25
 */

public class RedPointUtils {
    /**
     * 固定顶部和右边的内边距
     *
     * @param context
     * @param targetView
     * @param count
     */
    public static View setRedPoint(Context context, View targetView, int count) {


        if (count != 0) {
            return new QBadgeView(context).bindTarget(targetView).setBadgeNumber(count).getTargetView();
        }
        return targetView;
    }

    /**
     * 自定义距离顶部和右边的内边距
     *
     * @param context
     * @param targetView
     * @param count
     * @param topPadding
     * @param rightPadding
     */
    public static void setRedPoint(Context context, View targetView, int count, int topPadding, int rightPadding) {
        if (count != 0) {
            new QBadgeView(context).bindTarget(targetView).setBadgeNumber(count);
        }
    }
}
